package com.gxa.zhonglong.pojo;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * Created with IntelliJ IDEA.
 *
 * @author : 宸濯
 * Date: 2021/11/03 10:28
 * Description:
 * Version: V1.0
 */
public class StateConverter implements Converter<Integer> {
    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        //0 正常 1 异常
        if (value == null) {
            return new WriteCellData("");
        } else if (value == 0) {
            return new WriteCellData("待审核");
        } else if (value == 1) {
            return new WriteCellData("已通过");
        } else {
            return new WriteCellData("已驳回");
        }
    }
}
